<?php
/**
 * @package WordPress
 * @subpackage P2
 */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>" />
<title><?php wp_title(''); ?></title>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<link rel="stylesheet" href="<?php bloginfo( 'stylesheet_url' ); ?>" type="text/css" media="screen" />
<link rel="shortcut icon" href="/wp-content/themes/jiongtubaishi/img/favicon.ico">
<?php wp_head(); ?>

<script type="text/javascript">
	/* <![CDATA[ */
		function popupaddVideo(e) {
			jQuery('#postbox').toggle();
		}
		function poploginbox(e) {
			jQuery('#loginbox').toggle();
		}
		jQuery(document).ready(function($) {
			$('a#addVideo').live('click',popupaddVideo);
			$('a#poploginbox').live('click',poploginbox);
			jQuery('embed').attr({wmode:"opaque",autostart:"false"});
			$('object embed').before('<param name="wmode" value="transparent" />');
		});
	/* ]]> */
	</script>

</head>
<body <?php body_class(); ?>>

<?php if ( p2_user_can_post() && !is_archive() ) : ?>
		<?php locate_template( array( 'post-form.php' ), true ); ?>
<?php else : ?>
<div id="postbox">
		<div class="tip">
		<div class="pic_tip">
			<img src="/wp-content/themes/jiongtubaishi/img/pic_tip.gif">
		</div>
		<div class="wenzi_tip">
			<img src="/wp-content/themes/jiongtubaishi/img/wenzi_tip.png">
		</div>
		</div>
		
	<?php 
		if(function_exists('wp_connect')) {
			wp_connect(); 
		}
	?>
	
</div><!-- postbox -->
<?php endif; ?>


<div id="loginbox">
<div id="login">
<form name="loginform" id="loginform" action="/wp-login.php" method="post">
	<p style="font-size: 16px; font-weight: bold;">点击微博图标，直接登录。否则请输入用户名密码登录。</p>
	<?php 
		if(function_exists('wp_connect')) {
			wp_connect(); 
		}
	?>
	<p>
		<label for="user_login">用户名<br />
		<input type="text" name="log" id="user_login" class="input" value="" size="20" tabindex="10" /></label>
	</p>
	<p>

		<label for="user_pass">密码<br />
		<input type="password" name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" /></label>
	</p>
	
	<p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" /> 记住我的登录信息</label></p>
	<p class="submit">
		<input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="登录" tabindex="100" />

		<input type="hidden" name="redirect_to" value="<?php the_permalink(); ?>" />
		<input type="hidden" name="testcookie" value="1" />
	</p>
</form>

</div> <!-- login -->
</div> <!-- loginbox -->


<div id="header">

	<div class="sleeve">
		<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="/wp-content/themes/jiongtubaishi/img/header-logo.png"></a>
		
	</div>

</div>

<div class="menu-bar">
	
	<div class="menu">
		<div class="site_menu">
			<ul>
				<li class="menuout"><a id="highlight" href="/">最新发布</a></li>
				<li class="menuout" style="width: 196px;"><a id="addVideo" href="javascript:void(0)" title="分享路上的事。说说上下班途中、逛街旅行途中、放假回乡途中遇到的各种人和事，让大伙儿乐一乐、闻一闻。" alt="分享路上的事。说说上下班途中、逛街旅行途中、放假回乡途中遇到的各种人和事，让大伙儿乐一乐、闻一闻。">我要分享路上的事</a></li>
			<ul>
		</div> <!-- site_menu -->
		<div class="user_menu">
			<?php if ( is_user_logged_in() ) { ?>
				<ul>
					<li><span style="color: #FFAF60;">欢迎</span>，<span style="height: 16px; vertical-align:middle;"><?php echo get_avatar( get_current_user_id(), 16 );?></span>&nbsp;<!--  <a class="user_info" href="/wp-admin/profile.php" title="设置个人资料，绑定微博">--><?php global $current_user; get_currentuserinfo(); echo $current_user->display_name; ?></a></li>
					<li><a class="tuichu" href="<?php echo wp_logout_url("/"); ?>" title="退出">退出</a></li>
				</ul>
			<?php } else { ?>
		<ul>
					<li><a id="poploginbox" class="tuichu" href="javascript:void(0)" title="登录">登录</a></li>
				</ul>

			 <?php } ?> 
		</div> <!-- user_menu -->
	</div> <!-- menu -->
</div> <!-- menu-bar -->

<div id="wrapper">
	<?php get_sidebar(); ?>